5.3.3 APPX Application Design Manual

+ Chapter 1-1: Overview of Application Design
+ Chapter 1-2: Getting Started
+ Chapter 1-3: Data Dictionary
+ Chapter 1-4: Understanding Process Design
+ Chapter 1-5: Interprocess Communication
+ Chapter 1-6: Customizing Your Application
+ Chapter 1-7: The Documentation Facility
+ Chapter 1-8: Application Design Tools
+ Chapter 2-1: Data Dictionary Overview
+ Chapter 2-2: Data Dictionary Concepts
+ Chapter 2-3: Domains
+ Chapter 2-4: Files and Fields
+ Chapter 2-5: Work Fields
+ Chapter 3-1: Overview of APPX Processes
+ Chapter 3-2: Getting Started
+ Chapter 3-3: Process Definition
+ Chapter 3-4: Menu Processes
+ Chapter 3-5: Job Processes
+ Chapter 3-6: Input Processes
+ Chapter 3-7: Output Processes
+ Chapter 3-8: Update Processes
+ Chapter 3-9: Query Processes
+ Chapter 3-10: Inquiry Processes
+ Chapter 3-11: Status Processes
+ Chapter 3-12: Subroutine Processes
+ Chapter 3-13: Table Processes
+ Chapter 3-14: Automatic and Optional Children
+ Chapter 3-15: Using the Image Editor
+ Chapter 3-16: Using GUI Features of the Image Editor
+ Chapter 3-17: Using Event Points
+ Chapter 4-1: ILF Integration
+ Chapter 4-2: True/False Status Indicators
+ Chapter 4-3: Specifying Statements
+ Chapter 4-4: The ILF Editor
+ Chapter 4-5: The Appx ILF Debugger
- Chapter 4-6: ILF Keyword Reference
+ Chapter 4-7: Predefined Fields
+ Chapter 4-8: Runtime Subroutine's and Predefined Processes
+ Chapter 4-9: Appx Chart Director API

Chapter 4-6: ILF Keyword Reference

DATE BTW


The DATE BTW statement calculates the number of date/time units (years, months, days), between two date/time fields. It can be used to generate aging categories for reports, by comparing a value for date due with the current date to determine which customers have balances of less than 30 days, 30 to 60 days, over 60 days, and so forth.

  ????? DATE BTW ??? ?????????????????????? ??? ? ??? ?????????????????????? ???
  (1)            (2) (3)                    (4)(5)(6) (7)                    (8)

(1) T/F execution conditions
(2) From application ID
(3) From field name or PDF
(4) From occurrence (constant/index)
(5) Unit (8:centuries, 7:years, 6:months, 5:days, 4:hours, 3:minutes, 2:seconds, 1:hundredths)
(6) To application ID
(7) To field name, PDF, or constant
(8) To occurrence (constant/index)

Using the Statement

The unit (parameter 5) indicates the units of the result of the calculation. The result is returned in the predefined field BETWEEN.

If the 'from' date is greater than the 'to' date, BETWEEN is negative. If the 'from' date is less than the 'to' date, BETWEEN is positive.

When you use 'months' in DATE BTW, the result is zero if the 'from' month and year are the same as the 'to' month and year. In other words, if 'from' is February 1, 2000, and 'to' is February 28, 2000, BETWEEN is zero. If the 'from' month is different from the 'to' month, BETWEEN is zero unless there is at least a 28-day difference in the two dates. In other words, January 31 to February 5 is zero months, but January 31 to February 28 -- or January 1 to February 1 -- is one month.

Restrictions

Both fields in the statement must be date/time field types. Also, results can be unpredictable if you are using a date field without a century component. Confirm that your System Administrator has set up the Pivot Year environment variable to avoid unexpected results.

Execution Error

If either date is null, a runtime error occurs.

Related PDFs

BETWEEN

Related Statements

DATE ADD

Example

The following example uses the DATE BTW statement to compare the date due with the current date to determine categories of aging for an accounts receivable report: 

        SET DATE TAR WORK CURRENT DATE
        DATE BTW TAR INVOICE DUE DATE           5  TAR WORK CURRENT DATE
        IF   --- BETWEEN                        LT     30
  T     SET  TAR WORK CURRENT AMOUNT            =  TAR INVOICE AMOUNT
  F     IF   --- BETWEEN                        LT     60
  FT    SET  TAR WORK OVER 30 DAYS              =  TAR INVOICE AMOUNT
  FF    SET  TAR WORK OVER 60 DAYS              =  TAR INVOICE AMOUNT

Application Design Manual                                         "Powered by Appx Software"

636

©2006 By APPX Software, Inc. All Rights Reserved